<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="decorator" content="default"/>
 
	<title>添加监测设备</title>	
	
	<script type="text/javascript">	
		 
		$(function(){
		
		//取消功能
			$("#cancelBtn").click(function(){
			 	window.parent.location.reload(); 
				var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
				parent.layer.close(index); //再执行关闭    
				
			});
			
		//保存功能	 
			$("#confirmBtn").click(function(){
			
			var gwMac = $("#gwMac").val();
				if(gwMac==null||gwMac.trim()==""){
					$.jBox.tip("网关编号不能为空");					
					return false;
				}	
			
				var name = $("#name").val();
				if(name==null||name.trim()==""){
					$.jBox.tip("网关名称不能为空");
					return false;
				}	
				
				var severIp = $("#severIp").val();
				if(severIp==null||severIp.trim()==""){
					$.jBox.tip("服务器IP地址不能为空");
				
					return false;
				}	
				
				var iupr = $("#iupr").val();
				if(iupr==null||iupr.trim()==""){
					$.jBox.tip("监测频率不能为空");
				
					return false;
				}	
			
			
				window.parent.location.reload(); 
				var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
				parent.layer.close(index); //再执行关闭   
				
					//提交form
				var action="${ctx}/ccgwinfo/gatewayInfo/insertGateWay" ;  
				$("#inputForm").attr('action',action);    //通过jquery为action属性赋值
       			$("#inputForm").submit();    //提交ID为myform的表单 
			});
		});
	
	</script>
	<style type="text/css">
		body{
			color: #000000;
		}
	</style>
</head>
<body>
<form id="inputForm" class ="inputForm" method="post">		
	<div class="breadcrumb">
	
		<table class="table table-bordered">	
		<tr>
		<td>
			<label>网关编号</label>
			<span class="help-inline"><font color="red">*</font> </span>
		</td>
		<td>
			<input type="text" id="gwMac" name="gwMac" size="20" maxlength="20" required="true" value=""/> </td>			
		<td>
			<label>名称</label>
			<span class="help-inline"><font color="red">*</font> </span>
		</td>
		<td>		
			<span style="font-size:12px;">
				<select id = "name" name = "name" required="true" style="width:220px;">  
	  			<option value="GPRS温湿度记录仪">GPRS温湿度记录仪</option>  
		 			<option value="车载温湿度记录仪">车载温湿度记录仪</option>  
		 			<option value="WIFI温湿度记录仪">WIFI温湿度记录仪</option>  
		 			<option value="GPRS标签网关">GPRS标签网关</option>  
		 			<option value="WIFI标签网关">WIFI标签网关</option>  
		 			<option value="RJ45标签网关">RJ45标签网关</option>   
		 			<option value="总线式温湿度记录仪">总线式温湿度记录仪</option> 
		 			<option value="便携式温湿度记录仪">便携式温湿度记录仪</option>  
		 			<option value="氧气测量仪">氧气测量仪</option>   
		 			<option value="二氧测量仪">二氧测量仪</option> 
	 			</select>
 			</span>
		</td>		
		</tr>
		<tr>
		<td>
			<label>服务器IP地址</label>
			<span class="help-inline"><font color="red">*</font> </span>
			</td>			
		<td>	
			<input type="text" id="severIp" name="severIp" size="20" maxlength="20" required="true" value=""/> </td>			
		<td>
			<label>监测频率(分钟)</label>
			<span class="help-inline"><font color="red">*</font> </span>
			</td>
		<td>
			<input type="text" id="iupr" name="iupr" size="20" maxlength="20" required="true" value="5"/> </td>
			</td>
		</tr>
		<tr>
			<td><label>保修期限(月)</label></td>
				<td>
				<input type="text" id="warrantyPeriod" name="warrantyPeriod" size="20" maxlength="20" value=""/> </td>			
			<td><label>是否本地存储</label></td>
			<td>
				<label style="margin:5px;"><input class="i-checks" id="localStorage"  name="localStorage" type="checkbox" value = "0" onclick="this.value=(this.value==1)?0:1" /><span>本地存储</span></label> 		
			</td>
			
		</tr>
		 <tr>
		
			<td><label>是否断电报警</label></td>
			<td>
				<label style="margin:5px;"><input id="batoff"  name="batoff" type="checkbox"   value = "1" onclick="this.value=(this.value==1)?0:1" checked/><span>断电报警</span></label></td>		
			
			<td><label>是否低压报警</label></td>
			<td>
				<label style="margin:5px;"><input id="lowvoltageAlarm" name="lowvoltageAlarm" type="checkbox"  value = "1" onclick="this.value=(this.value==1)?0:1"  checked/><span>低压报警</span></label></td>		 	
		</tr>
		<tr>
			<td>
				<label>启用日期</label>
			</td>
			<td>
				<input type="datetime" id="startuseDate" name="startuseDate" style="width: 85%" class="Wdate"    onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"  />  
			</td>				
			<td><label>服务器</label></td>
			<td>
				 <span style="font-size:14px;">
					 <select id = "server" name = "server" style="width:220px;">  
			  			 <option value="无">无</option>  	 				
					 </select>  
				 </span>			
			</td> 	
		</tr>
		<tr>
			<td><label>校准日期</label></td>
			<td>
				<input type="datetime" id="calibrationDates" name="calibrationDates" style="width: 85%" class="Wdate"    onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"  />  				
			</td>
			 <td><label>用途</label></td>
			<td>
				  <span style="font-size:14px;">
					 <select id = "purpose" name = "purpose" style="width:220px;">  
			  			 <option value="疾控行业">疾控行业</option>  	
			  			 <option value="制药行业">制药行业</option>  				
					 </select>  
				 </span>
			</td>
		</tr>
		<tr>
			<td><label>状态</label></td>
				<td>
				 <span style="font-size:14px;">
					 <select id = "status" name = "status" style="width:220px;">  
			  			 <option value="正常">正常</option>  	
			  			 <option value="停用">停用</option>  		
			  			 <option value="无电源">无电源</option>  
			  			 <option value="无网络">无网络</option>  		
			  			 <option value="网络不稳定">网络不稳定</option> 				
					 </select>  
				 </span>
			</td> 
			<td><label></label></td>
			<td></td>	
			 		 
		</tr>					
	</table>			
	</div>

	<div style="margin-right:20px; margin-bottom: 10px;">
		<button  id="confirmBtn" style="margin-top: 20px;margin-left: 500px;"  class="btn btn-primary">保存</button> 
		<button id = "cancelBtn" style="margin-top: 20px;margin-left: 20px;"   class="btn btn-default">取消</button>
	</div>
	</form>
</body>
</html>
